extends "../../azurlane_ctrl/AzurItem.gd"
func init():
	.init()
	name = "[特殊]借调证明"
	info = "一次性消耗品，可将装备者的阵营永久转变"
	price = 300

func _connect():
	._connect()

	var itemWindow = utils.createWindowDialog(sys.main.get_node("ui"), "选择阵营", Vector2(500, 500))
	itemWindow.popup_exclusive = true
	itemWindow.get_close_button().hide()

	itemWindow.popup_centered()

	var taskBox = utils.createGridContainer(itemWindow, 2)
	taskBox.rect_position = Vector2(50, 50)
	taskBox.set_custom_minimum_size(Vector2(450, 450))

	utils.createRichTextLabel("重樱", taskBox, Vector2(350, 50))
	utils.createItemButton(taskBox, self, "选择", "doSelect", ["重樱", itemWindow])

	utils.createRichTextLabel("皇家", taskBox, Vector2(350, 50))
	utils.createItemButton(taskBox, self, "选择", "doSelect", ["皇家", itemWindow])

	utils.createRichTextLabel("白鹰", taskBox, Vector2(350, 50))
	utils.createItemButton(taskBox, self, "选择", "doSelect", ["白鹰", itemWindow])

	utils.createRichTextLabel("碧蓝航线", taskBox, Vector2(350, 50))
	utils.createItemButton(taskBox, self, "选择", "doSelect", ["碧蓝航线", itemWindow])

	utils.createRichTextLabel("赤色中轴", taskBox, Vector2(350, 50))
	utils.createItemButton(taskBox, self, "选择", "doSelect", ["赤色中轴", itemWindow])

func doSelect(camp, window):
	window.queue_free()
	masCha.setCamp(camp, true)
	delSelf()	